﻿// JScript 文件
//Creator:JackyLee,Time:13:30 2007-7-20

function RStation(stationId,stationName,latlng,transportType,cityId){
	this.toString=function(){
		return 'RStation';
	}
	if(stationId){
		this.stationId=stationId;
	}else{
		this.stationId=-1;
	}
	if(stationName){
		this.stationName=stationName;
	}else{
		this.stationName='';
	}
	if(latlng){
		this.latlng=latlng;
	}else{
		this.latlng=null;
	}
	if(transportType){
		this.transportType=transportType;
	}else{
		this.transportType=1;
	}
	if(cityId){
		this.cityId=cityId;
	}else{
		this.cityId=-1;
	}
	this.cityName='';
	this.passLines=new Array();
	
	this.getPassLineDescription=function(){
		var lineDescription='';
		for(var iLine=0; iLine<this.passLines.length;iLine++){
			lineDescription+='<a href="'+this.passLines[iLine].getLineDetailUrl()+'" target="_blank">'+this.passLines[iLine].lineName+'</a>'+', '
		}
		lineDescription=lineDescription.substring(0,lineDescription.length-1);
		return lineDescription;
	}
	
	this.getTransportType=function(){
		switch(this.transportType){
			case 1:
			case '1':
				return '公交';
			break;
			case 2:
			case '2':
				return '地铁';
			break;
			case 3:
			case '3':
				return '长途汽车';
			break;
			case 4:
			case '4':
				return '火车';
			break;
			case 5:
			case '5':
				return '飞机';
			break;
			case 6:
			case '6':
				return '轮船';
			break;
			default:
				return '未知';
			break;
		}
	}
	
	this.getDescriptionWithLink=function(){
		return '类型：'+this.getTransportType()+'<br>'
			+'城市：'+this.cityName+'<br>'
			+'瑞图号：'+rituEncoding(this.latlng.lat,this.latlng.lng)+'<br>'
			+'所经线路：'+this.getPassLineDescription();
	}
	
}